Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

大量のレコードを Export するとメモリを食いつぶし OS ごとフリーズしてしまう不具合の修正 #1145

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

K-Haruto
Copy link
Collaborator

関連Issue / Related Issue

不具合の内容 / Bug

データを Export する際に対象のレコード数が多いと, メモリを食いつぶしてフリーズする

原因 / Cause

ExportData()関数にて1度のクエリで大量のデータを取得している.
このとき, メモリサイズが事前に確保されておらず, CSVファイル出力前段階でメモリ使用量が急増していた.

変更内容 / Details of Change

1度に全てのデータを処理するのではなく, クエリを複数に分割し,
各クエリで取得したデータごとに逐次CSVファイルに書き出すように修正.
なお, 1度のクエリで処理するレコード数の上限は,
modules/Vtiger/actions/ExportData.php の$exportBatchLimitにて指定(デフォルト10,000)

スクリーンショット / Screenshot

影響範囲 / Affected Area

  • レコードのエクスポート機能

チェックリスト / Check List

  • 自らテストを行った
  • 不必要な変更が無い
  • 影響範囲の検討を行った

備考 / Remarks

10万点のレコードのエクスポートは本件の修正で実行できることを確認しました.
もし, 修正適用後もメモリ不足が発生する場合には, 上記$exportBatchLimitを変更してください.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant